<?php

namespace App\Http\Queries;

use App\Models\Vehicle;
use Spatie\QueryBuilder\QueryBuilder;
use Spatie\QueryBuilder\AllowedFilter;

class VehicleQuery extends QueryBuilder
{
    public function __construct()
    {
        parent::__construct(Vehicle::query());
        $this->allowedIncludes('activity');
        $this->allowedFilters([
            AllowedFilter::exact('recommend'),
            AllowedFilter::exact('vehicle_series_id'),
            AllowedFilter::exact('activity_id'),
        ]);
        $this->defaultSort('order');
    }
}
